﻿
using System;
using System.Xml;

namespace Xacml.Core.Configuration
{
  public abstract class NameTypeConfig
  {
    private string _name;
    private string _typeName;
    private Type _type;
    private XmlNode _node;

    public string Name
    {
      get
      {
        return this._name;
      }
    }

    public string TypeName
    {
      get
      {
        return this._typeName;
      }
    }

    public Type Type
    {
      get
      {
        return this._type;
      }
    }

    public XmlNode XmlNode
    {
      get
      {
        return this._node;
      }
    }

    protected NameTypeConfig(XmlNode configNode)
    {
      this._node = configNode;
      this._name = configNode.Attributes["name"].Value;
      this._typeName = configNode.Attributes["type"].Value;
      this._type = Type.GetType(this._typeName);
    }
  }
}
